/*
 * @Description: 结算方式
 * @Author: iamsmiling
 * @Date: 2021-06-09 22:38:19
 * @LastEditTime: 2021-06-15 14:52:20
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/dialog_wrapper/dialog_wrapper.dart';
import 'package:credit_business_circle/domain/local/settlement/settlement_entity.dart';
import 'package:flutter/material.dart';

Future showSettlementModeDemoDialog(BuildContext context) {
  List<SettlementEntity> list = [
    SettlementEntity(label: "CPS", description: "每销售成本：按完成订单的用户数量结算。"),
    SettlementEntity(
        label: "CPA",
        description: "每行动成本：CPA是一种按广告投放实际效果计价方式的广告，比如按照一个注册，搜索行为，浏览行为等等。"),
    SettlementEntity(
        label: "CPM", description: "每千人成本：只要向足够量级的用户展示了广告主的内容，广告主就为此付费。"),
    SettlementEntity(label: "CPC", description: "每点击成本：根据广告被点击的次数收费。"),
    SettlementEntity(label: "CPT", description: "每时间段成本：以固定价格买断一段时间内的广告位展示。"),
    SettlementEntity(label: "CPD", description: "每下载成本：比如按用户完成APP下载计费。"),
    SettlementEntity(
        label: "CPE", description: "用户互动计费：按用户的有效互动行为如点赞、收藏、关注、转发等方式来计算广告费用。"),
    SettlementEntity(
        label: "CPL",
        description: "以搜集潜在客户名单多少来收费：即每次通过特定链接，注册成功后付费的一个常见广告模式。"),
    SettlementEntity(
        label: "CPR",
        description:
            "每回应成本：以浏览者的每一个回应计费。 硬广告：直接介绍商品、服务内容的传统形式的广告，通过刊登报刊、设置广告牌、电台和电视台播出等进行宣传。"),
    SettlementEntity(label: "软广告", description: "各种类型的活动赞助"),
    SettlementEntity(
        label: "流量互换",
        description:
            "企业或商家寻找合作资源，以共赢模式实现网站、APP、微信公众号等平台的互相引流和推广，从而实现品牌的曝光和流量的低成本获取。"),
    SettlementEntity(label: "按粉丝"),
    SettlementEntity(label: "按条数"),
  ];
  return showDialog(
      context: context,
      builder: (BuildContext context) {
        return DialogWrapper(builder: (BuildContext context) {
          return Container(
            margin: EdgeInsets.only(
                bottom: R.dimen.dp40, right: R.dimen.dp24, top: R.dimen.dp24),
            padding: EdgeInsets.only(left: R.dimen.dp24, bottom: R.dimen.dp40),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                Text(
                  "结算方式示例说明",
                  style: TextStyle(
                      fontSize: R.dimen.sp16,
                      color: R.color.ff222222,
                      fontWeight: FontWeight.w600),
                ),
                SingleChildScrollView(
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      for (SettlementEntity item in list)
                        Text.rich(TextSpan(
                            text: "${item.label} ",
                            style: TextStyle(
                                height: 1.4,
                                color: R.color.fffe4120,
                                fontSize: R.dimen.sp13,
                                fontWeight: FontWeight.w600),
                            children: [
                              TextSpan(
                                  text: "${item.description}",
                                  style: TextStyle(
                                      fontSize: R.dimen.sp13,
                                      fontWeight: FontWeight.normal,
                                      color: R.color.ff333333))
                            ]))
                    ],
                  ),
                )
              ],
            ),
          );
        });
      });
}
